package com.study.module.datasource.config;

import com.zaxxer.hikari.HikariDataSource;

public class DataSourceFactory {

    public static HikariDataSource build(DataSourceProperties properties) {
        HikariDataSource druidDataSource = new HikariDataSource();
        druidDataSource.setDriverClassName(properties.getDriverClassName());
        druidDataSource.setJdbcUrl(properties.getUrl());
        druidDataSource.setUsername(properties.getUsername());
        druidDataSource.setPassword(properties.getPassword());
        return druidDataSource;
    }
}